<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv=Content-Type content="text/html;charset=utf-8">
    <title>HerXi内部API接口测试</title>
    <script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="js/debug.js"></script>
    <script type="text/javascript" src="js/jsonDB.js"></script>
    <script type="text/javascript" src="js/ajaxfileupload.js"></script>
    <script type="text/javascript" src="js/JSONFormat.js"></script>
    <script type="text/javascript" src="js/AjaxForm.js"></script>
    <link href="js/base.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(document).ready(function(){
            $(".submit").click( function () {
                $('.JSONFormat').html("");
                var url = $("#url").val() + "?app=" + $('input[name="service"]').val()
                        + "&act=" + $('input[name="method"]').val();
                var method = $(this).val();
                var param = $("#param").val();
                if($('input[name="url"]').val().length<1){
                    alert("必须填写接口服务器的url地址");
                }
                $.post("js/api.php",{"url":url,"method":method,"param":param},function(res) {
                    var json = new JSONFormat(res);
                    $('.JSONFormat').html('<pre>'+json.toString()+'</pre>');

                }, "json")


            })

        })

    </script>
</head>
<body>
    <h1>贺喜内部API测试平台</h1>
    <form>
        <table cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td class="lefttd">提交地址:</td>
                <td><input type="text" name="url" value="http://vpn-api.ios.herxi.com/index.php" class="text" id='url'/></td>
            </tr>
            <tr>
                <td class="lefttd">接口APP:</td>
                <td><input type="text" style="width:180px;" name="service" value="" class="text"/></td>
            </tr>
            <tr>
                <td class="lefttd">接口ACT:</td>
                <td><input type="text" style="width:180px;" name="method" value="" class="text"/></td>
            </tr>
            <tr>
                <td class="lefttd">API列表:</td>
                <td><select style="width:150px;" id="modules"></select>
                    <select style="width:250px;" id="api"></select></td>
            </tr>
            <tr>
                <td class="lefttd">参数:</td>
                <td><textarea id="param" name="params" class="textarea"></textarea></td>
            </tr>
            <tr>
                <td colspan="2">
                    <input type="button" value="GET" class="submit"/>
                    <input type="button" value="POST" class="submit"/>
                </td>
            </tr>
        </table>
        <table cellpadding="0" cellspacing="0" border="0" style="margin-top:30px;margin-left:20px;">
            <tr>
                <td><div class="JSONFormat textarea"></div></td>
            </tr>
        </table>
    </form>



</body>
</html>